package com.sren.boot.bootstrap;

import com.sren.boot.annotation.EnableHelloWorld;
import org.springframework.boot.WebApplicationType;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.context.ConfigurableApplicationContext;

/**
 * @author: renshuai
 * @date: 2019/11/23 上午11:49
 * @Description:
 */
@EnableHelloWorld
public class EnableHelloWorldBootstrap {

	public static void main(String[] args) {
		ConfigurableApplicationContext context = new SpringApplicationBuilder(EnableHelloWorldBootstrap.class)
				.web(WebApplicationType.NONE)
				.run(args);


		String helloWorld = context.getBean("helloWorld", String.class);
		System.out.println(helloWorld);
		context.close();
	}
}
